<?php if (!empty($posts) && is_array($posts)) { ?>

<?php
//    $count = 0;
    foreach ($posts as $post) {
        foreach ($profiles as $profile) {
            if ($post['actor_id'] == $profile['id']) {
//                $count++;
//
//                if (!($count > $start && $count <= $start + 15)) {
//                    continue;
//                }
?>
                <div class="UIIntentionalStory_Profile_First UIStory UIIntentionalStory"
                     id="div_story_3">
                    <a target="_blank" title="<?php echo $profile['name']; ?>"
                       class="UIIntentionalStory_Pic"
                       href="<?php echo $profile['url']; ?>"> <span
                            class="UIRoundedImage UIRoundedImage_LARGE UIRoundedImage_WHITE"> <img
                                class="UIRoundedImage_Image" alt="Nguyen Tan"
                                src="<?php echo ($profile['pic_square']) ? $profile['pic_square'] : 'http://static.ak.fbcdn.net/pics/q_silhouette.gif'; ?>"> <img
                                class="UIRoundedImage_CornersSprite" alt="" src="<?php echo $config ['frontendCss'] ?>facebook/images/jchlj5zu.png">
                        </span> </a>

                    <div class="UIIntentionalStory_Header">
                        <h3 class="UIIntentionalStory_Message">
                            <span
                                class="UIIntentionalStory_Names"> <a target="_blank"
                                                                 href="<?php echo $profile['url']; ?>"><?php echo $profile['name']; ?></a> </span><?php echo $post['message']; ?></h3>
                    </div>

                    <div class="commentable_item autoexpand_mode"
                         id="commentable_item_3675939_117652740667"><span
                            class="UIActionLinks UIActionLinks_bottom UIIntentionalStory_Info"> <span
                                class="UIIntentionalStory_InfoText"> <span
                                    class="UIIntentionalStory_Time"> <a target="_blank"
                                                                    href="<?php echo $post['permalink']; ?>"><?php echo getTime($post['created_time']); ?></a> </span> </span> </span>
                        <div id="comment_box_114225711941356_114226301941297"
                             class="comment_box"></div>
                    </div>
                </div>
<?php
//                break;
            }
        }
    }
?>

<?php } ?>
<?php
$url = $_REQUEST['url'];
$action = $_REQUEST['type'];
?>
<a class="morePostsA" href="javascript:getMorePosts('<?php echo $action?>',<?php echo $start + 15; ?>, '<?php echo $url?>')">
    <div class="morePosts">Click for More</div>
    <img id="imgLoadingMore" src="<?php echo $config ['frontendCss'] ?>facebook/images/6nr0un50.gif" style="margin:14px 0px 10px 5px; display: none;" />
</a>
